<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我的收藏</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <style media="screen">
        .guess_love {
            width: 100%;
            overflow: hidden;
            padding: 0 15px;
            box-sizing: border-box;
        }

        .guess_love>.title {
            width: 100%;
            overflow: hidden;
            display: flex;
            padding: 0 110px;
            box-sizing: border-box;
            justify-content: space-between;
        }

        .guess_love .title div.line {
            width: 17px;
            height: 1px;
            background: #FF4141;
            margin-top: 7px;
        }

        .guess_love .title div.text {
            height: 15;
            line-height: 15px;
            font-size: 14px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #FF4141;
            flex: 1;
            text-align: center;
        }

        .guess_love ul {
            width: 100%;
            overflow: hidden;
        }

        .guess_love ul li {
            width: 100%;
            overflow: hidden;
            display: flex;
            padding: 10px 0;
            border: none;
            background-size: 100% 1px;
            background-repeat: no-repeat;
            background-position: bottom;
            background-image: linear-gradient(0, #EEEEEE, #EEEEEE 50%, transparent 50%);
            background-image: -webkit-linear-gradient(90deg, #EEEEEE, #EEEEEE 50%, transparent 50%);
        }

        .guess_love ul li div.shop_picture {
            width: 100px;
            height: 100px;
            /*width: 100%;*/
            border-radius: 5px;
        }

        .guess_love ul li div.shop_picture img {
            display: block;
            width: 100%;
            height: 100%;
            border-radius: 5px;
        }

        .guess_love ul li div.shop_info {
            flex: 1;
            min-width: 0;
            margin-left: 6px;
            box-sizing: border-box;
        }

        .guess_love ul li div.shop_info div.title {
            display: flex;
        }

        .guess_love ul li div.shop_info div.title span:first-child {
            width: 25px;
            height: 12px;
            margin-top: 0.5px;
            margin-right: 4px;
        }

        .guess_love ul li div.shop_info div.title span:first-child img {
            display: block;
            width: 100%;
            height: 100%;
        }

        .guess_love ul li div.shop_info div.title span:last-child {
            width: auto;
            max-width: 202px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            height: 15px;
            line-height: 15px;
            font-size: 14px;
            /*font-weight: bolder;*/
        }

        .guess_love ul li div.shop_info div.price {
            display: flex;
            margin-top: 18px;
        }

        .guess_love ul li div.shop_info div.price span {
            height: 13px;
            line-height: 13px;
            font-size: 12px;
        }

        .guess_love ul li div.shop_info div.price span:last-child {
            color: #FF4141;
            font-size: 17px;
        }

        .guess_love ul li div.shop_info div.price span:first-child {
            color: #999999;
            font-size: 10px;
            line-height: 14px;
            /*font-weight: bolder;*/
        }

        .guess_love ul li div.shop_info div.price span:nth-child(2) {
            color: #666666;
            font-size: 10px;
            line-height: 14px;
        }

        .guess_love ul li div.shop_info div.coupons {
            display: flex;
            margin-top: 3px;
        }

        .guess_love ul li div.shop_info div.coupons span:first-child {
            width: 50px;
            height: 15px;
            /*background: #FFE3E3;*/
            font-size: 10px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #FF4141;
            text-align: center;
            line-height: 15px;
            background: url(../../image/arebuyingcoupon_bg.png) no-repeat;
            background-size: 100% 100%;
        }
        /*.guess_love ul li div.shop_info div.coupons span:last-child {
        width: 50px;
        height: 15px;
        background: linear-gradient(-90deg, #7519EB, #A329F3);
        border-radius: 2.5px;
        font-size: 10px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #fff;
        text-align: center;
        line-height: 15px;
        margin-left: 4px;
    }*/

        .guess_love ul li div.shop_info div.sold {
            width: auto;
            height: 12px;
            border-radius: 2.5px;
            font-size: 10px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #999999;
            /*text-align: center;*/
            line-height: 12px;
            margin-top: 6px;
        }

        .guess_love ul li div.shop_info div.name {
            width: auto;
            height: 12px;
            border-radius: 2.5px;
            font-size: 10px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #999999;
            /*text-align: center;*/
            line-height: 10px;
            margin-top: 6px;
        }

        .selected {
            width: 15px;
            height: 15px;
            margin-top: 42.5px;
        }

        .aui-checkbox {
            border-radius: 50%;
        }

        .aui-radio,
        .aui-checkbox {
            width: 15px;
            height: 15px;
            /*background-color: #ffffff;*/
            border: solid 1px #dddddd;
            -webkit-border-radius: 0.6rem;
            border-radius: 0.6rem;
            /*font-size: 0.8rem;*/
            margin: 0;
            padding: 0;
            position: relative;
            display: inline-block;
            vertical-align: top;
            cursor: default;
            -webkit-appearance: none;
            -webkit-user-select: none;
            user-select: none;
            -webkit-transition: background-color ease 0.1s;
            transition: background-color ease 0.1s;
        }

        .aui-radio:checked,
        .aui-radio.aui-checked,
        .aui-checkbox:checked,
        .aui-checkbox.aui-checked {
            background: url(../../image/select.png) no-repeat;
            background-size: 15px 15px;
            border: none;
            /*background-color: #49A76D;
      border: solid 1px #49A76D;
      text-align: center;
      background-clip: padding-box;
      background: -moz-linear-gradient(top, #49A76D 0%, #97E3B4 100%);*/
            /*background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #000000), color-stop(100%, #ffffff));
      background: -webkit-linear-gradient(top, #000000 0%, #ffffff 100%);
      background: -o-linear-gradient(top, #000000 0%, #ffffff 100%);
      background: -ms-linear-gradient(top, #000000 0%, #ffffff 100%);
      background: linear-gradient(to bottom, #000000 0%, #ffffff 100%);
      filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#ffffff', GradientType=0);*/
        }

        .aui-radio:checked:before,
        .aui-radio.aui-checked:before,
        .aui-checkbox:checked:before,
        .aui-checkbox.aui-checked:before,
        .aui-radio:checked:after,
        .aui-radio.aui-checked:after,
        .aui-checkbox:checked:after,
        .aui-checkbox.aui-checked:after {
            content: '';
            width: 0rem!important;
            height: 0rem!important;
            position: absolute;
            top: 0!important;
            left: 0!important;
            margin-left: 0rem!important;
            margin-top: 0rem!important;
            background: transparent;
            border: 0px solid #ffffff !important;
            border-top: none;
            border-right: none;
            z-index: 2;
            -webkit-border-radius: 0;
            border-radius: 0;
            -webkit-transform: rotate(-45deg);
            transform: rotate(-45deg);
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="guess_love">
            <ul>
                <li v-for='(item,index) in collectionData' @click='openGoodsDtailsPage(item.goodsId)'>
                    <div class="shop_picture">
                        <img :src="item.mainPic" alt="">
                    </div>
                    <div class="shop_info">
                        <div class="title">
                            <span v-if='item.shopType==1'><img src="../../image/tm.png" alt=""></span>
                            <span v-else><img src="../../image/tb_search.png" alt=""></span>
                            <span>{{item.title}}</span>
                        </div>
                        <div class="price">
                            <span>券后</span>
                            <span style="color:#FF4141;">￥</span>
                            <span>{{item.actualPrice}}</span>
                        </div>
                        <div class="coupons">
                            <span>{{item.couponPrice}}元券</span>
                        </div>
                        <div class="sold">已售{{item.monthSales}}</div>
                        <div class="name">{{item.shopName}}</div>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/cling.js"></script>
<script type="text/javascript">
    apiready = function() {
        api.addEventListener({
            name: 'backpage'
        }, function(ret, err) {
            if (ret) {
                vm.init();
            }
        });
        vm.init();
    }
    var vm = new Vue({
        el: '#app',
        data: {
            collectionData: [],
            ids: [],
            offset: 0
        },
        methods: {
            init: function(isClick) {
                console.log(cl.mid);
                console.log(cl.userToken)
                if (isClick) {
                    vm.offset += 10;
                } else { // 下拉刷新 或者 初次加载
                    vm.offset = 0;
                }
                cl.openLoading();
                api.ajax({
                    url: cl.apiServer + 'collectProducts/getList',
                    method: 'post',
                    headers: {
                        'Content-Type': 'application/json;charset=utf-8',
                        token: cl.userToken
                    },
                    data: {
                        body: {
                            limit: 10,
                            mid: cl.mid,
                            offset: vm.offset,
                            type: 1,
                            version:cl.deviceInfo().appVersion,
                            mobileInfo:cl.systemType()
                        }
                    }
                }, function(ret, err) {
                    // alert(JSON.stringify(ret))
                    if (ret) {
                        if (ret.code == 0) {
                            cl.closeLoading();
                            if (ret.data.length >= 10) {
                                vm.collectionData = vm.collectionData.concat(ret.data);
                            } else if (ret.data.length == 0) {
                                api.sendEvent({
                                    name: 'refreshCollection'
                                });
                            } else {
                                vm.collectionData = vm.collectionData.concat(ret.data);
                            }
                        }else if (ret.code == 401) {
                          cl.openWin({
                              name: '../login/code_login'
                          })

                        }
                    }
                })
            },
            openGoodsDtailsPage: function(id) {
                cl.openWin({
                    name: '../main/goods_deatils',
                    pageParam: {
                        id: id
                    }
                })
            }
        }
    });
</script>

</html>
